package com.example.hm_dtfkz.ui.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;

import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;

import com.bumptech.glide.Glide;
import com.dq.ad.utils.ToastUtil;
import com.example.hm_dtfkz.R;
import com.example.hm_dtfkz.databinding.ActivitySettingBinding;
import com.example.hm_dtfkz.databinding.WebViewLayoutBinding;
import com.example.hm_dtfkz.ui.base.VBBaseActivity;
import com.example.hm_dtfkz.util.SystemUtil;

public class WebViewActivity extends VBBaseActivity {
    private WebViewLayoutBinding webViewLayoutBinding;

    @SuppressLint("SetJavaScriptEnabled")
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String type = getIntent().getStringExtra("type");
        Glide.with(webViewLayoutBinding.bigImage)
                .load(type)
                .into(webViewLayoutBinding.bigImage);

        webViewLayoutBinding.tvDown.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SystemUtil.copyToClipboard(WebViewActivity.this, type);
                ToastUtil.showShortToast(WebViewActivity.this, "复制成功");
            }
        });

        webViewLayoutBinding.tTitle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }

    @Override
    protected ViewBinding getViewBinding() {
        return webViewLayoutBinding = WebViewLayoutBinding.inflate(getLayoutInflater());
    }
}
